<ng-form name="addImportProjectForm"
         class="add-import-project">

  <div class="add-import-project-toggle-buttons">
    <che-toggle-joined ng-model="addImportProjectController.activeProjectSource"
                       ng-change="addImportProjectController.sourceChanged()"
                       md-theme="default"
                       flex-order="2" flex-order-gt-md="1">
      <che-toggle-joined-button che-title="Samples"
                                id="samples-button"
                                che-value="addImportProjectController.projectSource.SAMPLES"></che-toggle-joined-button>
      <che-toggle-joined-button che-title="Blank"
                                id="blank-button"
                                che-value="addImportProjectController.projectSource.BLANK"></che-toggle-joined-button>
      <che-toggle-joined-button che-title="Git"
                                id="git-button"
                                che-value="addImportProjectController.projectSource.GIT"></che-toggle-joined-button>
      <che-toggle-joined-button che-title="GitHub"
                                id="github-button"
                                che-value="addImportProjectController.projectSource.GITHUB"></che-toggle-joined-button>
      <che-toggle-joined-button che-title="Zip"
                                id="zip-button"
                                che-value="addImportProjectController.projectSource.ZIP"></che-toggle-joined-button>
    </che-toggle-joined>
  </div>

  <div class="add-import-project-sources">
    <template-selector
      ng-if="addImportProjectController.activeProjectSource === addImportProjectController.projectSource.SAMPLES"></template-selector>
    <import-blank-project
      ng-if="addImportProjectController.activeProjectSource === addImportProjectController.projectSource.BLANK"
      is-project-name-unique="addImportProjectController.isProjectNameUnique({name: name})"></import-blank-project>
    <import-git-project
      ng-if="addImportProjectController.activeProjectSource === addImportProjectController.projectSource.GIT"></import-git-project>
    <import-github-project
      ng-if="addImportProjectController.activeProjectSource === addImportProjectController.projectSource.GITHUB"></import-github-project>
    <import-zip-project
      ng-if="addImportProjectController.activeProjectSource === addImportProjectController.projectSource.ZIP"></import-zip-project>
  </div>

  <md-divider></md-divider>

  <div class="add-import-project-button"
       flex layout="row" layout-align="end center">
    <che-button-cancel-flat che-button-title="Cancel"
                            id="cancel-button"
                            name="cancelButton"
                            ng-disabled="addImportProjectController.disableSaveAndCancelButtons()"
                            ng-click="addImportProjectController.projectTemplateOnCancel()"></che-button-cancel-flat>
    <che-button-primary che-button-title="Add"
                        id="add-project-button"
                        name="addButton"
                        ng-disabled="addImportProjectForm.$invalid || addImportProjectController.disableSaveAndCancelButtons()"
                        ng-click="addImportProjectController.projectTemplateOnSave()"></che-button-primary>
  </div>

</ng-form>

